{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "from modelscope.hub.snapshot_download import snapshot_download"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "2024-10-07 11:38:31,316 - modelscope - WARNING - Model revision not specified, use revision: v1.0.2\n",
      "Downloading: 100%|██████████| 1.70G/1.70G [00:22<00:00, 82.2MB/s]\n",
      "Downloading: 100%|██████████| 1.83G/1.83G [00:52<00:00, 37.5MB/s]\n",
      "Downloading: 100%|██████████| 1.80G/1.80G [00:42<00:00, 45.0MB/s]\n",
      "Downloading: 100%|██████████| 1.69G/1.69G [00:40<00:00, 44.5MB/s]\n",
      "Downloading: 100%|██████████| 1.83G/1.83G [01:01<00:00, 32.2MB/s]\n",
      "Downloading: 100%|██████████| 1.80G/1.80G [00:54<00:00, 35.1MB/s]\n",
      "Downloading: 100%|██████████| 0.98G/0.98G [00:30<00:00, 34.3MB/s]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'/data/models/modelscope\\\\ZhipuAI\\\\chatglm3-6b'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# model_id 模型id\n",
    "# cache_dir 本地缓存目录\n",
    "# ignore_file_pattern 无需下载的文件\n",
    "# ,ignore_file_pattern=[\"*.bin\"]\n",
    "# /data/models/modelscope/modelscope/Llama-2-7b-ms\n",
    "snapshot_download(model_id=\"ZhipuAI/chatglm3-6b\", cache_dir=\"/data/models/modelscope\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "ms",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.19"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
